// exports.User = void 0;
// var n = (function () {
//     function e() {
//         this._platform = {
//             avatarUrl: "",
//             nickName: ""
//         };
//         this._server = null;
//         this._code = "";
//         this._openId = null;
//         this._unionId = null;
//     }
//     e.getInstance = function () {
//         var t;
//         if (!(null !== (t = this._instance) && void 0 !== t)) {
//             this._instance = new e();
//         }
//         return this._instance;
//     };
//     Object.defineProperty(e.prototype, "platfrom", {
//         get: function () {
//             return this._platform;
//         },
//         set: function (e) {
//             Object.assign(this._platform, e);
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     Object.defineProperty(e.prototype, "server", {
//         get: function () {
//             return this._server;
//         },
//         set: function (e) {
//             this._server = e;
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     Object.defineProperty(e.prototype, "code", {
//         get: function () {
//             return this._code || "";
//         },
//         set: function (e) {
//             this._code = e;
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     Object.defineProperty(e.prototype, "openId", {
//         get: function () {
//             return this._openId || "";
//         },
//         set: function (e) {
//             this._openId = e;
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     Object.defineProperty(e.prototype, "unionId", {
//         get: function () {
//             return this._unionId || "";
//         },
//         set: function (e) {
//             this._unionId = e;
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     return e;
// })();
// exports.User = n.getInstance();


/**
 * 用户类
 * 建议类名: UserClass
 */
class User {
    // 私有静态实例
    private static _instance: User;

    // 平台信息
    private _platform: { avatarUrl: string; nickName: string };
    // 服务器信息
    private _server: any;
    // 代码
    private _code: string;
    // OpenID
    private _openId: string | null;
    // UnionID
    private _unionId: string | null;

    // 构造函数
    private constructor() {
        this._platform = {
            avatarUrl: "",
            nickName: ""
        };
        this._server = null;
        this._code = "";
        this._openId = null;
        this._unionId = null;
    }

    /**
     * 获取单例实例
     * @returns {User} 单例实例
     * 建议方法名: getInstance
     */
    public static getInstance(): User {
        if (!this._instance) {
            this._instance = new User();
        }
        return this._instance;
    }

    /**
     * 获取平台信息
     * @returns {{ avatarUrl: string; nickName: string }} 平台信息
     * 建议方法名: getPlatform
     */
    public get platform(): { avatarUrl: string; nickName: string } {
        return this._platform;
    }

    /**
     * 设置平台信息
     * @param {object} platform 平台信息
     * 建议方法名: setPlatform
     */
    public set platform(platform: { avatarUrl: string; nickName: string }) {
        Object.assign(this._platform, platform);
    }

    /**
     * 获取服务器信息
     * @returns {any} 服务器信息
     * 建议方法名: getServer
     */
    public get server(): any {
        return this._server;
    }

    /**
     * 设置服务器信息
     * @param {any} server 服务器信息
     * 建议方法名: setServer
     */
    public set server(server: any) {
        this._server = server;
    }

    /**
     * 获取代码
     * @returns {string} 代码
     * 建议方法名: getCode
     */
    public get code(): string {
        return this._code || "";
    }

    /**
     * 设置代码
     * @param {string} code 代码
     * 建议方法名: setCode
     */
    public set code(code: string) {
        this._code = code;
    }

    /**
     * 获取OpenID
     * @returns {string} OpenID
     * 建议方法名: getOpenId
     */
    public get openId(): string {
        return this._openId || "";
    }

    /**
     * 设置OpenID
     * @param {string} openId OpenID
     * 建议方法名: setOpenId
     */
    public set openId(openId: string) {
        this._openId = openId;
    }

    /**
     * 获取UnionID
     * @returns {string} UnionID
     * 建议方法名: getUnionId
     */
    public get unionId(): string {
        return this._unionId || "";
    }

    /**
     * 设置UnionID
     * @param {string} unionId UnionID
     * 建议方法名: setUnionId
     */
    public set unionId(unionId: string) {
        this._unionId = unionId;
    }
}

// 导出单例实例
export const UserInstance = User.getInstance();